Skip to content

feat(multi-select): upgrade multi select mechanic - #34

Merged
makuchpatryk merged 1 commit into
mainfrom
feat-multi-select-highlight-upgrade
Mar 4, 2026
Merged

feat(multi-select): upgrade multi select mechanic#34
makuchpatryk merged 1 commit into
mainfrom
feat-multi-select-highlight-upgrade

Conversation

@makuchpatryk

Copy link
Copy Markdown
Collaborator

No description provided.

@makuchpatryk
makuchpatryk requested a review from Copilot March 4, 2026 22:06
@makuchpatryk makuchpatryk self-assigned this Mar 4, 2026
@vercel

vercel Bot commented Mar 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
perplex-image Ready Ready Preview, Comment Mar 4, 2026 10:06pm

@makuchpatryk
makuchpatryk merged commit d82768a into main Mar 4, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the multi-select drag mechanic for the puzzle game. The key change is replacing a single highlight field (one highlighted piece) with highlightPositions: number[] (an array supporting multi-piece hover preview). It also introduces a dragContext mechanism to work around the browser security restriction that prevents reading dataTransfer data during dragenter events, and moves the game control toolbar (RESTART/PAUSE/Preview/stats) from below the board to a sticky header above it.

Changes:

  • Multi-tile drag preview: selected group's target slots are highlighted during hover, with validation against row-boundary wrapping
  • Sticky control toolbar: buttons and stats moved above the board as a sticky bar
  • Test updates: new E2E tests for group highlight preview (valid/invalid moves) and updated layout assertions to match the new UI

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
modules/game/composables/useEventGame.ts Adds dragContext, onDragStart, onDragEnd, clearHighlight, resolveDragContext; upgrades onDragEnter to compute multi-slot highlights
modules/game/components/Piece.vue Adds drag-start/drag-end events, data-highlighted/data-selected attributes, reads dataTransfer in dragenter for test compatibility
modules/game/views/GameView.vue Switches highlight to highlightPositions, moves toolbar to sticky top, wires new events
modules/game/types/index.ts Replaces highlight: number | string with highlightPositions: number[]
tests/e2e/multi-select.spec.ts Adds fireDragEnter/dragHover helpers and 3 new group-preview tests; updates selectors to use data-* attributes
tests/e2e/advanced.spec.ts Updates layout test to match new Preview button and stopwatch format

evt.dataTransfer.effectAllowed = "move";
evt.dataTransfer.setData("position", position);
// Przekaż listę zaznaczonych slotów, żeby drop wiedział o grupie
// Przekaz listę zaznaczonych slotów, żeby drop wiedział o grupie

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three Polish comment spelling errors were introduced in this diff (diacritical marks removed):

  1. Line 33: "Przekaz" should be "Przekaż" (missing ż)
  2. Line 36: "przeciagamy" should be "przeciągamy" (missing ą)
  3. Line 106: "Nakladka" should be "Nakładka" (missing ł)

Copilot uses AI. Check for mistakes.
evt.dataTransfer.setData("selectedPositions", JSON.stringify(selectedPositions));

// Customowy ghost image gdy przeciągamy grupę
// Customowy ghost image gdy przeciagamy grupę

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "przeciagamy" is missing the Polish diacritic ą and should be "przeciągamy".

Suggested change
// Customowy ghost image gdy przeciagamy grupę
// Customowy ghost image gdy przeciągamy grupę

Copilot uses AI. Check for mistakes.
@click="onPieceClick($event, item.position)"
>
<!-- Nakładka zaznaczenia -->
<!-- Nakladka zaznaczenia -->

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "Nakladka" is missing the Polish diacritic ł and should be "Nakładka".

Suggested change
<!-- Nakladka zaznaczenia -->
<!-- Nakładka zaznaczenia -->

Copilot uses AI. Check for mistakes.
alt=""
/>
<div
class="sticky top-2 z-30 mb-6"

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sticky toolbar has no background color set. When the page is scrolled, the puzzle board will be visible through the transparent toolbar area, making buttons and text difficult to read. Adding a background class (e.g., bg-white or a semi-transparent variant) to the sticky container would prevent content from bleeding through when the user scrolls down.

Suggested change
class="sticky top-2 z-30 mb-6"
class="sticky top-2 z-30 mb-6 bg-white/90 backdrop-blur-sm"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants